home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / machserver / 1.098 / raid / semaphore.h < prev    next >
C/C++ Source or Header  |  1990-11-09  |  1KB  |  36 lines

  1. /*
  2.  * sema.h --
  3.  *
  4.  * Copyright 1990 Regents of the University of California
  5.  * Permission to use, copy, modify, and distribute this
  6.  * software and its documentation for any purpose and without
  7.  * fee is hereby granted, provided that the above copyright
  8.  * notice appear in all copies.  The University of California
  9.  * makes no representations about the suitability of this
  10.  * software for any purpose.  It is provided "as is" without
  11.  * express or implied warranty.
  12.  *
  13.  * $Header: /sprite/src/kernel/raid/RCS/semaphore.h,v 1.2 90/11/09 13:49:46 eklee Exp $ SPRITE (Berkeley)
  14.  */
  15.  
  16. #ifndef _SEMA
  17. #define _SEMA
  18.  
  19. #include "sync.h"
  20. #include "syncLock.h"
  21.  
  22. typedef struct {
  23.     Sync_Semaphore    mutex;
  24.     int            val;
  25.     Sync_Condition    wait;
  26. } Sema;
  27.  
  28. #define LockSema(sema) (DownSema(sema))
  29. #define UnlockSema(sema) (UpSema(sema))
  30.  
  31. extern void InitSema _ARGS_((Sema *semaPtr, char *name, int val));
  32. extern void DownSema _ARGS_((Sema *semaPtr));
  33. extern void UpSema _ARGS_((Sema *semaPtr));
  34.  
  35. #endif /* _SEMA */
  36.